package com.gai.shop.dao;

import com.gai.shop.entity.User;

import java.util.List;

public interface UserDao {
    /**
     * 通过用户名查询用户
     * @param uname
     * @return
     * @throws Exception
     */
    User selectUserByUname(String uname) throws Exception;

    /**
     * 新增用户
     * @param user
     * @return
     */
    Integer addUser(User user) throws Exception;

    /**
     * 通过邮箱和激活码进行用户的查询，用于激活
     * @param uemail
     * @param ucode
     * @return
     */
    User selectUserByUemailAndUcode(String uemail, String ucode) throws Exception;

    /**
     * 激活用户状态为1
     * @param uid
     * @return
     */
    Integer updateUserUstatusByUid(Integer uid) throws Exception;

    /**
     *
     * @return
     */
    List<User> userList() throws Exception;

    /**
     * 动态查询
     * @param uname
     * @param usex
     * @return
     */
    List<User> userList(String uname, String usex) throws Exception;

    /**
     * 删除用户
     * @param uid
     * @return
     */
    Integer deleteUser(Integer uid) throws Exception;
}
